//получаем идентификатор элемента
var rootContainer = document.querySelector('#js-root-container');
var switchDarkModeBtn = document.getElementById('js-switch-dark-mode')

if (localStorage.getItem('dark-mode') == 1) {
    rootContainer.classList.add('museum-da');
} else {
    rootContainer.classList.remove('museum-da');
}

//вешаем на него событие
switchDarkModeBtn.onclick = function() {
    if (localStorage.getItem('dark-mode') == 1) {
        localStorage.setItem('dark-mode', 0);
    } else {
        localStorage.setItem('dark-mode', 1);
    }
    rootContainer.classList.toggle('museum-da');
}